import { Provider } from 'react-redux';
import store, { persistor } from '@/store';
import { PersistGate } from 'redux-persist/integration/react';

export function rootContainer(container: any) {
  return (
    <Provider store={store}>
      <PersistGate loading={null} persistor={persistor}>
        {container}
      </PersistGate>
    </Provider>
  );
}

// 确保全局样式在客户端和服务器端都能正确加载
export function onRouteChange({ location, routes, action }: any) {
  // 路由变化时的处理逻辑
  console.log('route location:', location);
  console.log('route routes:', routes);
  console.log('route action:', action);
}
